import React, { Component } from 'react'
import router from "../router/index.js"
import { NavLink } from "react-router-dom"

export default class Nav extends Component {

    handleClick() {
        console.log('点击了我的');
    }

    // 生命周期
    componentDidMount() {
        console.log('生命周期加载菜单')
        console.log(router)
    }
    render() {
        return (
            <div className="nav">
                <ul className="ul">
                    { router.map((e, i) => (<li className="li" key={i}><NavLink  className="items" to={e.path}>{e.title}</NavLink></li>)) }
                </ul>
            </div>
        )
    }
    
}
